//
//  UIView+DebugSubViews.m
//  TravelGuideMdd
//
//  Created by 陈曦 on 13-11-12.
//  Copyright (c) 2013年 mafengwo.com. All rights reserved.
//

#import "UIView+DebugSubViews.h"

@implementation UIView(DebugSubViews)


- (void)print:(UIView*)aSub deep:(NSUInteger)deep
{
    NSMutableString *s = [[NSMutableString alloc] init];
    for (NSUInteger i = 0 ;i < deep;i++)
    {
        [s appendString:@"    "];
    }
    [s appendFormat:@"%@",aSub];
    NSLog(@"%@",s);
    [aSub.subviews enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
        [self print:obj deep:deep + 1];
    }];
}

- (void)printSubViews
{
    [self print:self deep:0];
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect
{
    // Drawing code
}
*/

@end
